** MASTER FILE

ssc install reghdfe
ssc install ivreghdfe
ssc install egenmore
ssc install ftools
ssc install gtools
ssc install sutex2
ssc install outreg2
ssc install geodist 
ssc install parmest
ssc install estout

** DEFINE DIRECTORIES
global P_Main "PATH_TO_MAIN_DIRECTORY_WHERE_THE_CODE_IS" 
* e.g., "/home/ubuntu/replication_package/"
cd "$P_Main"

* where all data is
global P_Data "$P_Main/Data"
* where all the processed data goes
global P_Data_Processed "$P_Data/processed"
* where figures go
global P_Figures "$P_Main/Figures"
* where tables go
global P_Tables "$P_Main/Tables"

** Create Date Concordance file between y2kW (from Python) and Stata dates
do "$P_Main/Stata_1_date_concordance.do"

** COMPUTE STRUCTURAL BREAK DATES (GENERATES .XLS files)

do "$P_Main/Stata_2_structural_breaks.do"

** COMBINE STRUCTURAL BREAKS  (TAKES .XLS files, converts to STATA, and COMPUTES COMBOS)

do "$P_Main/Stata_3_break_combinations.do"

** PREPAERS THE DATA FOR THE MAIN TEXT TABLES AND FIGURES - this code runs 
*** all of the files Stata_4_Data_Prep_a - Stata_4_Data_Prep_j

do "$P_Main/Stata_4_Data_Prep_.do"

** PRODUCES MAIN TABLES 1-10 IN THE PAPER

do "$P_Main/Stata_5_main_text_results.do"

** PRODUCES MAIN FIGURES 1-3 + A1 IN THE PAPER 

do "$P_Main/Stata_6_main_text_figures.do"

** PRODUCE APPENDIX FIGURES 
do "$P_Main/Stata_7_appendix_Figure_B1_B2.do"
do "$P_Main/Stata_7_appendix_Figure_C1.do"
do "$P_Main/Stata_7_appendix_Figure_D1.do"
do "$P_Main/Stata_7_appendix_Figure_D2.do"
do "$P_Main/Stata_7_appendix_Figure_D3.do"
do "$P_Main/Stata_7_appendix_Figure_D4.do"
do "$P_Main/Stata_7_appendix_Figure_D5.do"
do "$P_Main/Stata_7_appendix_Figure_D6.do"
do "$P_Main/Stata_7_appendix_Figure_F1.do"

** PRODUCE APPENDIX TABLES 
do "$P_Main/Stata_7_appendix_Table_D1.do"
do "$P_Main/Stata_7_appendix_Table_E1.do"
do "$P_Main/Stata_7_appendix_Table_E2.do"
do "$P_Main/Stata_7_appendix_Table_E3.do"
do "$P_Main/Stata_7_appendix_Table_E4.do"
do "$P_Main/Stata_7_appendix_Table_G1.do"
do "$P_Main/Stata_7_appendix_Table_G2.do"
do "$P_Main/Stata_7_appendix_Table_G3.do"
do "$P_Main/Stata_7_appendix_Table_G5.do"
do "$P_Main/Stata_7_appendix_Table_G6.do"
do "$P_Main/Stata_7_appendix_Table_G7.do"
do "$P_Main/Stata_7_appendix_Table_G8.do"
do "$P_Main/Stata_7_appendix_Table_G9.do"
do "$P_Main/Stata_7_appendix_Table_G10.do"
do "$P_Main/Stata_7_appendix_Table_G11.do"

** IMPORTANT - BEFORE RUNNING THIS FILE ($P_Main/Stata_7_appendix_Table_G4.do), IT'S IMPORTANT TO RUN THE FOLLOWING
** PYTHON FILE: Data_17_Appendix_Big_Breaks.py
do "$P_Main/Stata_7_appendix_Table_G4.do"


